<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('简历列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>面试编号：</label>
                                <input type="text" name="resId"/>
                            </li>
                            <li>
                                <label>面试回数：</label>
                                <!-- <input type="text" name="resNo"/> -->
                                <select name="resNo">
                                    <option value="">所有</option>
                                    <option value="" >一面</option>
                                    <option value="222" >二面</option>
                                    <option value="333">三面</option>
                                </select>
                            </li>
                            <li>
                                <label>面试状态：</label>
                                <!-- <input type="text" name="resStatus"/> -->
                                <select name="resStatus">
                                    <option value="">所有</option>
                                    <option value="1" >未分配</option>
                                    <option value="0" >关闭</option>
                                    <option value="10">等待简历review</option>
                                    <option value="20" >等待指定面试官</option>
                                    <option value="21" >等待确定面试时间</option>
                                    <option value="22" >等待提交面试反馈</option>
                                    <option value="11">简历ReviewNG</option>
                                    <option value="24" >面试oK</option>
                                    <option value="25" >面试NG</option>
                                    <option value="30">Hold</option>
                                    <option value="31">Offer发送完了</option>

                                </select>
                            </li>
                            <li>
                                <label>姓名：</label>
                                <input type="text" name="resName"/>
                            </li>
                            <li>
                                <label>联系电话：</label>
                                <input type="text" name="resTel"/>
                            </li>
                            <li>
                                <label>学历：</label>
                                <!-- <input type="text" name="resDegree"/> -->
                                <select name="resDegree">
                                    <option value="">所有</option>
                                    <option value="专科" >专科</option>
                                    <option value="本科" >本科</option>
                                    <option value="硕士">硕士</option>
                                </select>
                            </li>
                            <li class="select-time">
                                <label>毕业时间：</label>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginResGdate]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endResGdate]"/>
                            </li>
                            <li>
                                <label>毕业院校：</label>
                                <input type="text" name="resGraduate"/>
                            </li>
                            <li>
                                <label>专业：</label>
                                <!-- <input type="text" name="resSpeciality"/> -->
                                <select name="resSpeciality">
                                    <option value="">所有</option>
                                    <option value="国际英语" >国际英语</option>
                                    <option value="国际日语">国际日语</option>
                                    <option value="软件工程">软件工程</option>
                                    <option value="计算机科学">计算机科学</option>
                                    <option value="土木工程">土木工程</option>

                                </select>
                            </li>
                            <li>
                                <label>主要技术：</label>
                                <!-- <input type="text" name="resTechnology"/> -->
                                <select name="resTechnology">
                                    <option value="">所有</option>
                                    <option value="C#" >C#</option>
                                    <option value="Java">Java</option>
                                    <option value="Python">Python</option>
                                </select>
                            </li>
                            <li>
                                <label>语言水平：</label>
                                <!-- <input type="text" name="resLanguage"/> -->
                                <select name="resLanguage">
                                    <option value="">所有</option>
                                    <option value="N1" >N1</option>
                                    <option value="N2">N2</option>
                                    <option value="N3">N3</option>
                                    <option value="英语四级">英语四级</option>
                                    <option value="英语六级">英语六级</option>
                                    <option value="英语八级">英语八级</option>
                                </select>
                            </li>
                            <li>
                                <label>现在公司：</label>
                                <input type="text" name="resCompany"/>
                            </li>
                            <li>
                                <label>简历来源：</label>
                                <!-- <input type="text" name="resOrigin"/> -->
                                <!-- <select name="resOrigin" th:with="type=${@users.getSysUserList()}">
                                    <option value="">所有</option>
                                    <option th:each="users : ${type}" th:text="${users.userName}" th:value="${users.userId}"></option>
                                </select> -->
                                <select id="resOrigin" name="resOrigin" >
                                    <option value="">所有</option>
                                    <option value="1">内部推荐</option>
                                    <option value="2">HR</option>
                                    <option value="3">社会招聘</option>
                                </select>
                            </li>
                            <li class="select-time">
                                <label>修改时间：</label>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginUt]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endUt]"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <!-- <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:resume:add">
                    <i class="fa fa-plus"></i> 添加
                </a> -->
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:resume:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:resume:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:resume:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:resume:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:resume:remove')}]];
        var downloadFlag = [[${@permission.hasPermi('system:resume:download')}]];
        var reviewFlag = [[${@permission.hasPermi('system:resume:review')}]];
        var interviewFlag = [[${@permission.hasPermi('system:resume:interview')}]];
        var evaluateFlag = [[${@permission.hasPermi('system:resume:evaluate')}]];
        var prefix = ctx + "system/resume";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "简历",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'resId',
                    title: '面试者编号',
                    sortable: true
                    
                },
                {
                    field: 'resFile',
                    title: '简历文件路径',
                    visible: false,
                    sortable: true
                },
                {
                    field: 'resNo',
                    title: '面试回数',
                    sortable: true,
                    formatter: function(value, item, index) {
                        if (item.resNo == '1') {
                            return '<span class=" ">一面</span>';
                        }
                        else{
                            return '<span class=" ">一面</span>';
                        }
                    }
                },
                {
                    field: 'resStatus',
                    title: '状态',
                    sortable: true,
                    formatter: function(value, item, index) {
		                if (item.resStatus == '1') {
		                    return '<span class=" ">未分配</span>';
		                }
		                else if (item.resStatus == '0') {
		                    return '<span class=" ">关闭</span>';
		                }
		                else if (item.resStatus == '10') {
		                    return '<span class=" ">等待简历review</span>';
		                }
                        else if (item.resStatus == '20') {
		                    return '<span class=" ">等待指定面试官</span>';
		                }
                        else if (item.resStatus == '21') {
		                    return '<span class=" ">等待确定面试时间</span>';
		                }
                        else if (item.resStatus == '22') {
		                    return '<span class=" ">等待提交面试反馈</span>';
		                }
                        else if (item.resStatus == '11') {
		                    return '<span class=" ">简历ReviewNG</span>';
		                }
                        else if (item.resStatus == '24') {
		                    return '<span class=" ">面试oK</span>';
		                }
                        else if (item.resStatus == '25') {
		                    return '<span class=" ">面试NG</span>';
		                }
                        else if (item.resStatus == '30') {
		                    return '<span class=" ">Hold</span>';
		                }
                        else if (item.resStatus == '31') {
		                    return '<span class=" ">Offer发送完了</span>';
		                }
		            }
                },
                {
                    field: 'resName',
                    title: '姓名',
                    sortable: true
                },
                {
                    field: 'resSex',
                    title: '性别',
                    sortable: true,
                    formatter: function(value, item, index) {
		                if (item.resSex == '0') {
		                    return '<span class="label label-success">男</span>';
		                }
		                else if (item.resSex == '1') {
		                    return '<span class="label label-primary">女</span>';
		                }
		                else if (item.resSex == '2') {
		                    return '<span class="label label-warning">未知</span>';
		                }
		            }
                },
                {
                    field: 'resTel',
                    title: '联系电话',
                    sortable: true
                },
                {
                    field: 'resDegree',
                    title: '学历',
                    sortable: true
                },
                {
                    field: 'resGdate',
                    title: '毕业时间',
                    sortable: true
                },
                {
                    field: 'resGraduate',
                    title: '毕业院校',
                    sortable: true
                },
                {
                    field: 'resSpeciality',
                    title: '专业',
                    sortable: true
                },
                {
                    field: 'resTechnology',
                    title: '主要技术',
                    sortable: true
                },
                {
                    field: 'resLanguage',
                    title: '语言水平',
                    sortable: true
                },
                {
                    field: 'resCompany',
                    title: '现在的公司',
                    visible: false,
                    sortable: true
                },
                {
                    field: 'resOrigin',
                    title: '简历的来源',
                    formatter: function(value, item, index) {
		                if (item.resOrigin == '1') {
		                    return '<span class=" ">内部推荐</span>';
		                }
		                else if (item.resOrigin == '2') {
		                    return '<span class=" ">HR</span>';
		                }
		                else if (item.resOrigin == '3') {
		                    return '<span class=" ">社会招聘</span>';
		                }
                        else{
		                    return '<span class=" ">其他</span>';
		                }
                       
		            }
                },
                {
                    // field: 'resUser',
                    field: 'resUserName',
                    title: '内部推荐人',
                    visible: false
                },
                {
                    // field: 'resAction',
                    field: 'resActionName',
                    title: 'Action Owner',
                    sortable: true
                },
                {
                    field: 'resBan',
                    title: '参考的ban范围',
                    visible: false
                },
                {
                    field: 'resJob',
                    title: '参考的职位',
                    visible: false
                },
                {
                    field: 'cu',
                    title: '添加人',
                    visible: false
                },
                {
                    field: 'ct',
                    title: '添加时间',
                    visible: false
                },
                {
                    field: 'uu',
                    title: '修改人',
                    visible: false
                },
                {
                    field: 'ut',
                    title: '修改时间',
                    visible: false
                },
                {
                    title: '操作',
                    align: 'center',
                    // formatter: function(value, row, index) {
		            //     if (row.userId != 1) {
		            //     	var actions = [];
			        //         actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editTab(\'' + row.userId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
			        //         actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.userId + '\')"><i class="fa fa-remove"></i>删除</a> ');
			        //         var more = [];
			        //         more.push("<a class='btn btn-default btn-xs " + resetPwdFlag + "' href='javascript:void(0)' onclick='resetPwd(" + row.userId + ")'><i class='fa fa-key'></i>重置密码</a> ");
			        //         more.push("<a class='btn btn-default btn-xs " + editFlag + "' href='javascript:void(0)' onclick='authRole(" + row.userId + ")'><i class='fa fa-check-square-o'></i>分配角色</a>");
			        //         actions.push('<a tabindex="0" class="btn btn-info btn-xs" role="button" data-container="body" data-placement="left" data-toggle="popover" data-html="true" data-trigger="hover" data-content="' + more.join('') + '"><i class="fa fa-chevron-circle-right"></i>更多操作</a>');
			        //         return actions.join('');
		            // 	} else {
		            //         return "";
		            //     }
		            // }
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.resId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        var more = [];
                            more.push("<a class='btn btn-default btn-xs " + downloadFlag +"' href='javascript:void(0)' onclick='download1(" +row.resId+")'><i class='fa fa-edit'></i>简历下载</a>");
			                more.push("<a class='btn btn-primary btn-xs " + reviewFlag + "' href='javascript:void(0)' onclick='review(" + row.resId + ")'><i class='fa fa-edit'></i>简历review</a>");
                            more.push("<a class='btn btn-warning btn-xs " + interviewFlag + "' href='javascript:void(0)' onclick='interview2(" + row.resId + ")'><i class='fa fa-edit'></i>更新面试官</a>");
                            more.push("<a class='btn btn-success btn-xs " + evaluateFlag + "' href='javascript:void(0)' onclick='evaluate3(" + row.resId + ")'><i class='fa fa-edit'></i>简历反馈</a>");
			                // more.push("<a class='btn btn-success btn-xs " + editFlag + "' href='javascript:void(0)' onclick='$.operate.edit(" + row.resId +" )'><i class='fa fa-edit'></i>编辑</a>");
			                more.push("<a class='btn btn-danger btn-xs " + removeFlag + "' href='javascript:void(0)' onclick='$.operate.remove(" + row.resId +" )'><i class='fa fa-remove'></i>删除</a>");
                            actions.push('<a tabindex="0" class="btn btn-info btn-xs" role="button" data-container="body" data-placement="left" data-toggle="popover" data-html="true" data-trigger="hover" data-content="' + more.join('') + '"><i class="fa fa-chevron-circle-right"></i>动作</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);

       
        });
        // /**
        //  * @author: xxj
        //  * @description:
        //  * @date 2022/12/19 16:53
        //  */
         /* 简历review*/
		function review(resId) {
            location.reload();
		    var url = prefix + '/review/'+resId;
            //当前页面跳转到指定的界面
            window.location.href=url;
            // 打开新的标签页
		    // $.modal.openTab("简历review", url);
		}
         /* 简历下载*/
		function download1(resId) {
            // location.reload();
            // $.table.importTemplate2()
		    var url = prefix + '/download/'+resId;
            window.location.href =url
            // 打开新的标签页
		    // $.modal.openTab("简历review", url);
		}
         /* 更新面试官*/
		function interview2(resId) {
            location.reload();
		    var url = prefix + '/interview/'+resId;
            //当前页面跳转到指定的界面
            window.location.href=url;
		}
         /* 简历评价*/
         function evaluate3(resId) {
            location.reload();
		    var url = prefix + '/evaluate/'+resId;
            //当前页面跳转到指定的界面
            window.location.href=url;
		}
        

    </script>
</body>
</html>